package cn.yunyichina.provider.pay.paymentsetting;

import cn.yunyichina.provider.pay.exception.PaySettingNotFoundException;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.fastjson.JSON;

import cn.yunyichina.provider.pay.entity.PaymentSetting;
import cn.yunyichina.provider.pay.service.impl.PaymentSettingServiceImpl;


public class PaymentSettingTestUnit {
static ClassPathXmlApplicationContext applicationContext=null;
	
	static{
		applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
		applicationContext.start();	
	}
	
	@Test
	public void testQueryPaymentSettingByAppId() throws PaySettingNotFoundException {
		PaymentSettingServiceImpl service=(PaymentSettingServiceImpl)applicationContext.getBean("paymentSettingServiceImpl"); 
		PaymentSetting paymentSetting=service.queryPaymentSettingByAppId("2016043001352155");
		System.out.println(JSON.toJSONString(paymentSetting));
	}
	
	@Test
	public void testQueryPaymentSettingByAppcodeAndOrgcode() throws PaySettingNotFoundException {
		PaymentSettingServiceImpl service=(PaymentSettingServiceImpl)applicationContext.getBean("paymentSettingServiceImpl");
		String platformOrgAppCode="yytcda5b2de00d8717c";
		String orgCode="gzzyydxdyfsyy";
		short payMode=12;
		PaymentSetting paymentSetting= service.queryPaymentSettingByAppcodeAndOrgcodeAndPaymode(platformOrgAppCode, orgCode, payMode);
		System.out.println(JSON.toJSONString(paymentSetting));
	}
}
